from django.db import models

# Create your models here.
# 文章评论表单设置
class Comment(models.Model):
    name = models.CharField(max_length=100)
    email = models.EmailField(max_length=255)
    url = models.URLField(blank=True)
    text = models.TextField()
    created_time = models.DateTimeField(auto_now_add=True)

    post = models.ForeignKey('blog.Post')

    def __str__(self):
        return self.text[:20]
    class Meta:
        verbose_name = '评论表'  # 设置表名称在django后台显示的中文名称
        verbose_name_plural = verbose_name